<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
  <head>
  	<link rel="stylesheet" type="text/css" href="<c:url value='/css/Pub.css'/>"></link>
  	<script type="text/javascript">
  		var path = "<c:url value='/'/>";
  	</script>
      <meta http-equiv="pragma" content="no-cache">
      <meta http-equiv="cache-control" content="no-cache">
      <meta http-equiv="expires" content="0">
      <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
      <meta http-equiv="description" content="This is my page">
      <!-- 如果出现没有效果的情况直接检查是否是因为路径的问题 -->
      <link rel="stylesheet" href="${pageContext.request.contextPath}/easyui/themes/default/easyui.css" type="text/css"></link>
      <link rel="stylesheet" href="${pageContext.request.contextPath}/easyui/themes/icon.css" type="text/css"></link>
      <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery.min.js"></script>
      <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery.easyui.min.js"></script>
      <style type="text/css">
          a {
              text-decoration:none;
          }
      </style>
  </head>
  <body>
  		<p>订单信息：</p>
  		<div>
            <table class="easyui-datagrid" style="width:400px;height:250px"
                   data-options="url:'datagrid_data.json',fitColumns:true,singleSelect:true">
                <thead>
                <tr>
                    <th data-options="field:'code',width:100,align:'center'">订单名称</th>
                    <th data-options="field:'name',width:100,align:'center'">订单结果</th>
                </tr>
                </thead>
            <tbody>

            <tr>
                <td>
                    订单编号：
                </td>
                <td>
                    <input class="txt" readonly="readonly" type="text" name="id" id="id" value="${order.id}"/>
                </td>
            </tr>
            <tr>
                <td>
                    收货人/地址：
                </td>
                <td>
                    <input class="txt" readonly="readonly" type="text" id="consignee" name="consignee" value="${order.consignee}"/>
                </td>
            </tr>
            <tr style="background:#E0E0E0;">
                <td>
                    总金额：
                </td>
                <td>
                    <input style="text-align: center;" class="txt" readonly="readonly" value="${order.amt}元" type="text" name="amt" id="amt"/>
                </td>
            </tr>
            <tr>
                <td>
                    支付方式：
                </td>
                <td>
                    <c:choose>
                        <c:when test="${order.paytype==1}">
                            货到付款
                        </c:when>
                        <c:otherwise>
                            网银转账
                        </c:otherwise>
                    </c:choose>
                </td>
            </tr>
            </tbody>
            </table>
  		</div>
  		<p>订单明细：</p>
        <table id = "table" class="easyui-datagrid" style="width:400px;height:250px"
               data-options="url:'datagrid_data.json',fitColumns:true,singleSelect:true,fixed:true" >
            <thead>
            <tr>
                <th data-options="field:'code',width:100,align:'center'">书名</th>
                <th data-options="field:'name',width:100,align:'center'">数量</th>
                <th data-options="field:'price',width:100,align:'center'" >价格</th>
                <th data-options="field:'price',width:100,align:'center'">合计</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${order.orderLines}" var="line">
                <tr >
                    <td align="center">
                        <a target="_new" href="<c:url value='/index?action=queryBook&id=${line.bookid}'/>">
                                ${line.name}
                        </a>
                    </td>
                    <td>
                            ${line.amt}
                    </td>
                    <td>
                            ${line.price}
                    </td>
                    <td>
                            ${line.sum}
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
  </body>
</html>
